Patient de-identification Process API - Implementation Template
Setup guide
Importing Templates into Anypoint Studio
- In Studio, click the Exchange X icon in the upper left of the taskbar.
- Log in with your Anypoint Platform credentials.
- Search for the template.
- Click Open.
Running Templates in Anypoint Studio
After you import your template into Studio, follow these configuration steps to run it:
Common Configuration
mule.env- sets the environment where the application is to be deployed. It should be configured inconfig-<mule.env>.yamlfile. For a studio deployment, the recommended mule.env value islocal.mule.key- sets the encryption password to be used for encrypting secure properties. Update as needed.api.autodiscoveryIDshould be configured inconfig-<mule.env>.yamlfile.
Please refer to the attached link on how to secure the configuration properties.
HTTPS Configuration
https.host— sets the service host interface. It should be configured inconfig-<mule.env>.yamlfile. (Defaults to 0.0.0.0 for all interfaces).https.port— sets the HTTPS service port number. It should be configured inconfig-<mule.env>.yamlfile. (Default 8082).- TLS Configuration - Keystore properties setup:
keystore.alias- sets the alias to the keystore. It should be configured inconfig-<mule.env>.yamlfile.keystore.path- sets the path to the key file. Key should be available in /src/main/resources/keystore. It should be configured inconfig-<mule.env>.yamlfile.keystore.keypass— sets keystore keypass to support HTTPS operation. It should be encrypted and configured inconfig-secured-<mule.env>.yamlfile.keystore.password— sets keystore password to support HTTPS operation. It should be encrypted and configured inconfig-secured-<mule.env>.yamlfile.
Please refer to the attached link on how to generate the Keystore.
MariaDB Configuration
A MariaDB is needed for this application to store ehr and de-identified ids of each resource. Once a MariaDB instance is identified and access is obtained, run the create-schema.sql script available under src/test/resources/scripts folder.
MuleSoft's DB Connector requires database name, host, username, and password to communicate with MariaDB. After obtaining the necessary credentials, configure it in the properties file located in config folder.
hls.database.nameshould be encrypted and configured inconfig-<env>.yamlfile.hls.database.hostshould be encrypted and configured inconfig-<env>.yamlfile.hls.database.usernameshould be configured inconfig-<env>.yamlfile.hls.database.passwordshould be encrypted and configured inconfig-secured-<env>.yamlfile.
Please refer to the attached link on how to secure the configuration properties.
Anypoint MQ Connector Configuration
MuleSoft's Anypoint MQ Connector requires clientId, clientSecret, queueName and url to communicate with Anypoint MQ.
After obtaining the necessary credentials, configure it in the config-<mule.env>.yaml file located in /src/main/resources/config folder.
Ensure the Anypoint MQ queue names mentioned for anypoint-mq.queue-name and anypoint-mq.dl-queue-name properties in the property file are created and configured the Default Acknowledgement Timeout to at least 10 minutes and set Default Delivery Delay to 1 minute for the queue.
anypoint-mq.client-idshould be configured in theconfig-<env>.yamlfile.anypoint-mq.client-secretshould be encrypted and configured inconfig-secured-<env>.yamlfile.anypoint-mq.server-urlshould be configured in theconfig-<env>.yamlfile.anypoint-mq.queue-nameshould be configured in theconfig-<env>.yamlfile.anypoint-mq.dl-queue-nameshould be configured in theconfig-<env>.yamlfile.anypoint-mq.acknowledgementTimeoutshould be configured in theconfig-<env>.yamlfile.
System APIs and Other Configurations
The application requires few properties to be configured, mainly the system API connection information.
healthlake-sys-api.hostshould be configured inconfig-<mule.env>.yamlfile.healthlake-sys-api.portshould be configured inconfig-<mule.env>.yamlfile.healthlake-sys-api.clientidshould be configured inconfig-<mule.env>.yamlfile.healthlake-sys-api.clientsecretshould be encrypted and configured inconfig-secured-<mule.env>.yamlfile.generic-fhir-client-sys-api.hostshould be configured inconfig-<mule.env>.yamlfile.generic-fhir-client-sys-api.clientidshould be configured inconfig-<mule.env>.yamlfile.generic-fhir-client-sys-api.clientsecretshould be encrypted and configured inconfig-secured-<mule.env>.yamlfile.
Additionally, this application requires configurations related to the authorization mechanism leveraged to establish the connectivity with EHR for Bulk Export.
ehr.nameshould be configured inconfig-<mule.env>.yamlfile based on the EHR. The allowed values areepicandcerner.authorization.connectionTypeshould be configured inconfig-<mule.env>.yamlfile based on the authorization type configured on EHR. The allowed values arejsonwebtokenandclientcredential.
Configure the below set of properties for jsonwebtoken connection type:
jsonwebtoken.baseUrlshould be configured inconfig-<mule.env>.yamlfile.jsonwebtoken.tokenUrlshould be configured inconfig-<mule.env>.yamlfile.jsonwebtoken.clientidshould be configured inconfig-<mule.env>.yamlfile.jsonwebtoken.clientsecretshould be encrypted and configured inconfig-secured-<mule.env>.yamlfile.
Configure the below set of properties for clientcredential connection type:
clientcredential.baseUrlshould be configured inconfig-<mule.env>.yamlfile.clientcredential.tokenUrlshould be configured inconfig-<mule.env>.yamlfile.clientcredential.clientidshould be configured inconfig-<mule.env>.yamlfile.clientcredential.clientsecretshould be encrypted and configured inconfig-secured-<mule.env>.yamlfile.clientcredential.scopeshould be configured inconfig-<mule.env>.yamlfile.
Please refer to the attached link on how to secure the configuration properties.
Assumptions and constraints
- Adjust the value of
anypoint-mq.aknowledgementTimeoutproperty to prevent the reprocessing of the same message. Set this value based on the number of FHIR resources to be exported and the volume for each FHIR resource. - Postal Code will be de-identified based on the population size derived from decennial census data. If the population size for a particular postal code cannot be determined, the code will be masked with zeros.
- The application currently supports using the decennial census data from files bundled as static resource files in the application. If census data needs to be refreshed, overwrite the files under the
src/main/resources/static-datafolder. - Data store should be secured to protect the source system resource instance identifiers
- The application also provide a reference implementation to invoke Decennial Profile of Census API to determine the size of population for a given postal code. However, this functionality has not been utilized. The implementation can be enhanced to invoke the Census API by configuring the appropriate credentials to leverage the postal code validation in real-time.
Run it
- Right-click the template project folder.
- Hover your mouse over Run as.
- Click Mule Application (configure).
- Inside the dialog, select Environment and set the variable mule.env to the appropriate value (e.g dev or local).
- Inside the dialog, select Environment and set the variable mule.key to the property encryption key that you used to encrypt your secure properties. Click Run.
Web Application
After deploying the application, the user can reach the web UI at /api/webapp/index.html. This UI uses the /api/export endpoint to get all of the current config information. The UI can be used to create new configurations, delete existing configurations, view configuration details, or edit parts of existing configurations.
Deployment instructions for CloudHub using provided scripts
Ensure the Maven profile CloudHub-DEV has been properly configured in your settings.xml file. Reference can be found by downloading the Accelerator Common Resources asset. Additional instructions are available in the Getting Started with MuleSoft Accelerators - Build Environment guide.
Update the config-<env>.yaml properties appropriately and then use one of the following scripts to deploy the application to CloudHub:
- packageDeploy.sh or deployOnly.sh (Mac/Linux)
- packageDeploy.cmd or deployOnly.cmd (Windows)
Test it
- Use Advanced Rest Client or Postman to send a request over HTTPS. The template includes a Postman Collection in the
src/test/resourcesfolder.